//
//  DetailTableViewCell.m
//  壳牌喜力促销积分商城
//
//  Created by xrd on 15/3/17.
//  Copyright (c) 2015年 xrd. All rights reserved.
//

#import "DetailTableViewCell.h"
#import "DetailMode.h"


@interface DetailTableViewCell()
@property (weak, nonatomic) IBOutlet UIImageView *iconName;
@property (weak, nonatomic) IBOutlet UILabel *nameLabel;
@property (weak, nonatomic) IBOutlet UILabel *scoreLabel;

@end
@implementation DetailTableViewCell

- (void)awakeFromNib {
    // Initialization code
}
+ (instancetype)cellWithTableView:(UITableView *)tableView
{
    static NSString *ID = @"detailCell";
   DetailTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:ID];
    
    if (cell == nil) {
        // 从xib文件读取
        cell = [[[NSBundle mainBundle] loadNibNamed:@"DetailTableViewCell" owner:nil options:nil] lastObject];
    }
    
    return cell;
}

//  在这里进行所有数据的分发
- (void)setDetailMode:(DetailMode *)detailMode
{
    _detailMode = detailMode;
    
    // 1.  图片
    self.iconName.image = [UIImage imageNamed:detailMode.iconName];
    
    // 2. 名字
    self.nameLabel.text = detailMode.nameLabel;
    NSLog(@"oooooooo%@",self.nameLabel.text);
    // 3. 积分价格
    self.scoreLabel.text  = [NSString stringWithFormat:@"商品积分%@",detailMode.scoreLabel];
    
    
    
}



- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
